// 泛型的类型约束
interface ILength {
  length: number
}
function getLength<T extends ILength>(arg: T) {
  return arg.length
}


getLength('abc')
getLength(['abc', 'cba'])
getLength({ length: 100 })

